<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
	<title>分驾校管理后台</title>
	 <link rel="icon" href="../assets/img/favicon.ico">


    <link rel="stylesheet" type="text/css" href="css/webbase.css" />
    <link rel="stylesheet" type="text/css" href="css/pages-login-manage.css" />
    
</head>

<body>
	<div class="loginmanage">
		<div class="py-container">
			<h4 class="manage-title">三峰驾校分驾校管理后台</h4>
			<div class="loginform">

				<ul class="sui-nav nav-tabs tab-wraped">
					<li class="active">
						<a href="#profile" >
							<h3>账户登录</h3>
						</a> 
					</li>
					<li >
						<a href="#profile" >
							<h3>总校账号</h3>
						</a>
					</li>
				</ul>
				<div class="tab-content tab-wraped">
					<div id="index" class="tab-pane">
						<p>二维码登录，暂为官网二维码</p>
						<img src="" />
					</div>
					<div id="profile" class="tab-pane  active">
						<form class="sui-form" >
						<!-- action="/user/login1" method="post" id="loginfrom" -->
							<div class="input-prepend"><span class="add-on loginname"></span>
								<input id="username"  name="username" type="text" placeholder="邮箱/用户名/手机号" class="span2 input-xfat">
							</div>
							<div class="input-prepend"><span class="add-on loginpwd"></span>
								<input id="password"  name="password" type="password" placeholder="请输入密码" class="span2 input-xfat">
							</div>
							<!-- <div class="setting">
								 <div id="slider">
									<div id="slider_bg"></div>
									<span id="label">>></span> <span id="labelTip">拖动滑块验证</span>
									</div>
							</div> -->
							<div class="logined">
								<a class="sui-btn btn-block btn-xlarge btn-danger" onclick="submit()" target="_blank">登&nbsp;&nbsp;录</a>
							</div>
						</form>

					</div>
				</div>
			</div>
			<div class="clearfix"></div>
		</div>
	</div>


	<!--foot-->
	<div class="py-container copyright">
 		<ul>
			<li>轻松学车</li>
			<li>安全驾驶</li>
			<li>精心施教</li>
			<li>贴心服务</li>
			<li>你我同行</li>
			<li>圆梦驾驶</li>
			
		</ul> 
<!-- 		<div class="address">地址：青岛市   邮编：xxxxxxxxxxx 电话：xxxxxxxx 传真：xxxxxxxxxxxx</div>
		<div class="beian">
		</div> -->
	</div>


<script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="js/plugins/jquery-placeholder/jquery.placeholder.min.js"></script>
<script src="js/pages/jquery.slideunlock.js"></script>
<script>
	$(function(){
		var slider = new SliderUnlock("#slider",{
				successLabelTip : "欢迎访问卜莲堂"	
			},function(){
				// alert("验证成功,即将跳转至首页");
            	// window.location.href="index.html"
        	});
        slider.init();
        
       
	})
	
	function submit(){
    	  var username = $('#username').val();
    	  var password = $('#password').val();
    	  
    	  console.log(username,password);
    	  //get()方式
    	  $.ajax({
    	     url:'./user/login1.do',
    	     type:'get',
    	     data:{
    	    	 username:username,
    	    	 password:password
    	     },
    	     dataType:'json',
    	     success:function(data){
    	        console.log(data,'userinfo');
    	        if (typeof(Storage) !== "undefined") {
    	            // 针对 localStorage/sessionStorage 的代码
    	        	// 存储
    	        	
    	        	if(data.statusCode == 200){
    	        		if(data.user.status != 0){
    	        			localStorage.setItem("username", data.user.username);
            	        	localStorage.setItem("status", data.user.status);	
            	        	location.href="./admin/index.html";
    	        		}else{
    	        			alert('请前往总校登录页面')
    	        		}
    	        		
    	        	}else if(data.statusCode == 400){
    	        		alert('用户名或密码不正确')
    	        		/* location.href="login.html"; */
    	        	}
    	        } else {
    	            // 抱歉！不支持 Web Storage ..
    	            alert('抱歉！该浏览器版本低不支持，请更换浏览器，建议使用谷歌浏览器 ');
    	        }
    	        
    	     },
    	     error:function(error){
    	        console.log(error)
    	     }
    	  })
       }
	</script>
</body>

</html>